package com.wwl.cms.utils.designModeTest.mediator.smarthouse;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/26 17:00
 * @description:
 */
public class ClientTest {
    public static void main(String[] args) {
        //创建一个中介者对象
        Mediator mediator = new ConcreteMediator();

        //创建Alarm并且加入到ConcreteMediator 对象的HashMap
        Alarm alarm = new Alarm(mediator,"alarm");

        CoffeeMachine coffeeMachine = new CoffeeMachine(mediator,"coffeeMachine");

        Curtains curtains = new Curtains(mediator,"curtains");

        TV tv = new TV(mediator,"TV");

        //
        alarm.SendAlarm(0);
        coffeeMachine.FinishCoffee();
        alarm.SendAlarm(1);
    }
}
